/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package at.fhj.ase.shoppingcart.impl;

import at.fhj.ase.shoppingcart.MAddress;
import at.fhj.ase.shoppingcart.MArticle;
import at.fhj.ase.shoppingcart.MCustomer;
import at.fhj.ase.shoppingcart.MDate;
import at.fhj.ase.shoppingcart.MDouble;
import at.fhj.ase.shoppingcart.MInteger;
import at.fhj.ase.shoppingcart.MLong;
import at.fhj.ase.shoppingcart.MNamedElement;
import at.fhj.ase.shoppingcart.MOrder;
import at.fhj.ase.shoppingcart.MProperty;
import at.fhj.ase.shoppingcart.MShoppingCart;
import at.fhj.ase.shoppingcart.MString;
import at.fhj.ase.shoppingcart.MType;
import at.fhj.ase.shoppingcart.ShoppingcartFactory;
import at.fhj.ase.shoppingcart.ShoppingcartPackage;

import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;

import org.eclipse.emf.ecore.impl.EPackageImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Package</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class ShoppingcartPackageImpl extends EPackageImpl implements ShoppingcartPackage {
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass mNamedElementEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass mTypeEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass mPropertyEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass mStringEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass mDoubleEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass mIntegerEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass mLongEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass mDateEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass mCustomerEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass mArticleEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass mShoppingCartEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass mOrderEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass mAddressEClass = null;

	/**
	 * Creates an instance of the model <b>Package</b>, registered with
	 * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
	 * package URI value.
	 * <p>Note: the correct way to create the package is via the static
	 * factory method {@link #init init()}, which also performs
	 * initialization of the package, or returns the registered package,
	 * if one already exists.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see org.eclipse.emf.ecore.EPackage.Registry
	 * @see at.fhj.ase.shoppingcart.ShoppingcartPackage#eNS_URI
	 * @see #init()
	 * @generated
	 */
	private ShoppingcartPackageImpl() {
		super(eNS_URI, ShoppingcartFactory.eINSTANCE);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private static boolean isInited = false;

	/**
	 * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
	 * 
	 * <p>This method is used to initialize {@link ShoppingcartPackage#eINSTANCE} when that field is accessed.
	 * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #eNS_URI
	 * @see #createPackageContents()
	 * @see #initializePackageContents()
	 * @generated
	 */
	public static ShoppingcartPackage init() {
		if (isInited) return (ShoppingcartPackage)EPackage.Registry.INSTANCE.getEPackage(ShoppingcartPackage.eNS_URI);

		// Obtain or create and register package
		ShoppingcartPackageImpl theShoppingcartPackage = (ShoppingcartPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof ShoppingcartPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new ShoppingcartPackageImpl());

		isInited = true;

		// Create package meta-data objects
		theShoppingcartPackage.createPackageContents();

		// Initialize created meta-data
		theShoppingcartPackage.initializePackageContents();

		// Mark meta-data to indicate it can't be changed
		theShoppingcartPackage.freeze();

  
		// Update the registry and return the package
		EPackage.Registry.INSTANCE.put(ShoppingcartPackage.eNS_URI, theShoppingcartPackage);
		return theShoppingcartPackage;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getMNamedElement() {
		return mNamedElementEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getMNamedElement_Name() {
		return (EAttribute)mNamedElementEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getMType() {
		return mTypeEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getMProperty() {
		return mPropertyEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getMProperty_Readable() {
		return (EAttribute)mPropertyEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getMProperty_Writable() {
		return (EAttribute)mPropertyEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getMProperty_Type() {
		return (EReference)mPropertyEClass.getEStructuralFeatures().get(2);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getMString() {
		return mStringEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getMDouble() {
		return mDoubleEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getMInteger() {
		return mIntegerEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getMLong() {
		return mLongEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getMDate() {
		return mDateEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getMCustomer() {
		return mCustomerEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getMCustomer_Properties() {
		return (EReference)mCustomerEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getMArticle() {
		return mArticleEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getMArticle_Properties() {
		return (EReference)mArticleEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getMShoppingCart() {
		return mShoppingCartEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getMShoppingCart_Properties() {
		return (EReference)mShoppingCartEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getMOrder() {
		return mOrderEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getMOrder_Properties() {
		return (EReference)mOrderEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getMAddress() {
		return mAddressEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getMAddress_Properties() {
		return (EReference)mAddressEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ShoppingcartFactory getShoppingcartFactory() {
		return (ShoppingcartFactory)getEFactoryInstance();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isCreated = false;

	/**
	 * Creates the meta-model objects for the package.  This method is
	 * guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void createPackageContents() {
		if (isCreated) return;
		isCreated = true;

		// Create classes and their features
		mNamedElementEClass = createEClass(MNAMED_ELEMENT);
		createEAttribute(mNamedElementEClass, MNAMED_ELEMENT__NAME);

		mTypeEClass = createEClass(MTYPE);

		mPropertyEClass = createEClass(MPROPERTY);
		createEAttribute(mPropertyEClass, MPROPERTY__READABLE);
		createEAttribute(mPropertyEClass, MPROPERTY__WRITABLE);
		createEReference(mPropertyEClass, MPROPERTY__TYPE);

		mStringEClass = createEClass(MSTRING);

		mDoubleEClass = createEClass(MDOUBLE);

		mIntegerEClass = createEClass(MINTEGER);

		mLongEClass = createEClass(MLONG);

		mDateEClass = createEClass(MDATE);

		mCustomerEClass = createEClass(MCUSTOMER);
		createEReference(mCustomerEClass, MCUSTOMER__PROPERTIES);

		mArticleEClass = createEClass(MARTICLE);
		createEReference(mArticleEClass, MARTICLE__PROPERTIES);

		mShoppingCartEClass = createEClass(MSHOPPING_CART);
		createEReference(mShoppingCartEClass, MSHOPPING_CART__PROPERTIES);

		mOrderEClass = createEClass(MORDER);
		createEReference(mOrderEClass, MORDER__PROPERTIES);

		mAddressEClass = createEClass(MADDRESS);
		createEReference(mAddressEClass, MADDRESS__PROPERTIES);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isInitialized = false;

	/**
	 * Complete the initialization of the package and its meta-model.  This
	 * method is guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void initializePackageContents() {
		if (isInitialized) return;
		isInitialized = true;

		// Initialize package
		setName(eNAME);
		setNsPrefix(eNS_PREFIX);
		setNsURI(eNS_URI);

		// Create type parameters

		// Set bounds for type parameters

		// Add supertypes to classes
		mPropertyEClass.getESuperTypes().add(this.getMNamedElement());
		mStringEClass.getESuperTypes().add(this.getMType());
		mDoubleEClass.getESuperTypes().add(this.getMType());
		mIntegerEClass.getESuperTypes().add(this.getMType());
		mLongEClass.getESuperTypes().add(this.getMType());
		mDateEClass.getESuperTypes().add(this.getMType());
		mCustomerEClass.getESuperTypes().add(this.getMNamedElement());
		mArticleEClass.getESuperTypes().add(this.getMNamedElement());
		mShoppingCartEClass.getESuperTypes().add(this.getMNamedElement());
		mOrderEClass.getESuperTypes().add(this.getMNamedElement());
		mAddressEClass.getESuperTypes().add(this.getMNamedElement());

		// Initialize classes and features; add operations and parameters
		initEClass(mNamedElementEClass, MNamedElement.class, "MNamedElement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getMNamedElement_Name(), ecorePackage.getEString(), "name", null, 0, 1, MNamedElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(mTypeEClass, MType.class, "MType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		initEClass(mPropertyEClass, MProperty.class, "MProperty", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getMProperty_Readable(), ecorePackage.getEBoolean(), "readable", null, 0, 1, MProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getMProperty_Writable(), ecorePackage.getEBoolean(), "writable", null, 0, 1, MProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEReference(getMProperty_Type(), this.getMType(), null, "type", null, 1, 1, MProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(mStringEClass, MString.class, "MString", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		initEClass(mDoubleEClass, MDouble.class, "MDouble", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		initEClass(mIntegerEClass, MInteger.class, "MInteger", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		initEClass(mLongEClass, MLong.class, "MLong", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		initEClass(mDateEClass, MDate.class, "MDate", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

		initEClass(mCustomerEClass, MCustomer.class, "MCustomer", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getMCustomer_Properties(), this.getMProperty(), null, "properties", null, 0, -1, MCustomer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(mArticleEClass, MArticle.class, "MArticle", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getMArticle_Properties(), this.getMProperty(), null, "properties", null, 0, -1, MArticle.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(mShoppingCartEClass, MShoppingCart.class, "MShoppingCart", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getMShoppingCart_Properties(), this.getMProperty(), null, "properties", null, 0, -1, MShoppingCart.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(mOrderEClass, MOrder.class, "MOrder", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getMOrder_Properties(), this.getMProperty(), null, "properties", null, 0, -1, MOrder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(mAddressEClass, MAddress.class, "MAddress", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getMAddress_Properties(), this.getMProperty(), null, "properties", null, 0, -1, MAddress.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		// Create resource
		createResource(eNS_URI);
	}

} //ShoppingcartPackageImpl
